QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Aspect Ratio Cameras

An aspect ratio camera is a type of perspective camera defined in terms of a viewing angle and a horizontal-to-vertical aspect ratio, as shown in Figure 11 . With an aspect ratio camera, you don't specify the distance to the view plane directly (as you do with a view plane camera).

Figure 11 An aspect ratio camera

The orientation of the field of view is determined by the specified aspect ratio. If the aspect ratio is greater than 1.0, the field of view is vertical. If the aspect ratio is less than 1.0, the field of view is horizontal. In general, to avoid distortion, the aspect ratio should be the same as the aspect ratio of the camera's view port.

You can easily see that as the field of view increases, the view plane must move closer to camera location for the view port to fit within the field of view, in which case the image size decreases (because of perspective foreshortening). Conversely, as the field of view decreases, the view plane must move away from the camera location, and the image size increases.

Note that you can always find a view plane camera that is projectively identical to any aspect ratio camera. (The converse is not true: it's not always possible to find an aspect ratio camera that is projectively identical to an arbitrary view plane camera.) Consider the aspect ratio camera shown in Figure 12 . It's easy to specify a view plane camera that creates the same image as that aspect ratio camera. To do this, set the center of the cross section ( c x c y ) to be the origin (0, 0), and set the half-width d x to be the quantity d  tan(/2), where d is the distance from the camera to the view plane and is the horizontal field of view. (The half-angle applies to the smaller of the two view port dimensions.)

Figure 12 The relation between aspect ratio cameras and view plane cameras

See "Aspect Ratio Camera Data Structure" for more details on the data you need to provide to define an aspect ratio camera. See "Managing Aspect Ratio Cameras" for a description of the routines you can use to create and manipulate aspect ratio cameras.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |